package main

import (
	"fmt"
	"log"
	"net/http"
)

func main() {
	http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
		fmt.Fprintln(writer, "Hello world")
	})

	if err := http.ListenAndServe(":8080", nil); err != nil {
		log.Fatal(err)
	}

	//避免主函数退出，是主函数pending住
	/*go func() {
		if err := http.ListenAndServe(":8080",nil);err != nil {
			log.Fatal(err)
		}
	}()

	select {

	}*/
}
